#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QSqlTableModel>
#include <QThread>

#include "faceobject.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE




class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QTcpServer *m_server;
    QTcpSocket *m_socket;//accpet客户端之后产生的套接字
    quint64 buf_size;

    QThread *m_thread;
    FaceObject *m_faceop;
    QSqlTableModel *model;

    void create_json(int epy_id, QString &name, QString &part);

private slots:
    void accpet_clt();
    void rcv_from_clt();

    void get_faceid(const int face_id);
signals:
    void ask_faceid(cv::Mat& img);

};
#endif // MAINWINDOW_H
